Stefan Monnier [Thu, 28 Mar 2024 19:31:04 +0000 (15:31 -0400)]
pp.el: Try and fix bug#70039
* lisp/emacs-lisp/pp.el (pp-fill): Avoid splitting `#N#` or `#[`.
* test/lisp/emacs-lisp/pp-tests.el (pp-tests--sanity): New test.
Stefan Monnier [Thu, 28 Mar 2024 16:27:54 +0000 (12:27 -0400)]
* lisp/emacs-lisp/cl-macs.el (list): Predefine predicate by hand
Eli Zaretskii [Thu, 28 Mar 2024 10:15:13 +0000 (12:15 +0200)]
Fix a typo in flymake.el
* lisp/progmodes/flymake.el (flymake--update-eol-overlays): Use
'save-restriction', not 'save-excursion'. (Bug#69984)
Joseph Turner [Sat, 23 Mar 2024 20:29:17 +0000 (13:29 -0700)]
copy-tree just image map, not entire image
* lisp/image.el (image--compute-original-map): Copy only
the image map. (Bug#69602)
Eli Zaretskii [Thu, 28 Mar 2024 09:50:22 +0000 (11:50 +0200)]
; * etc/NEWS: Announce new feature of Proced. (Bug#69784)
Rahguzar [Fri, 15 Mar 2024 17:46:46 +0000 (18:46 +0100)]
Allow for auto updating only visible proced buffers (bug#69784)
* lisp/proced.el (proced-auto-update-flag): Document 'visible'
value and add it to the custom type.
(proced-auto-update-timer, proced-toggle-auto-update): Take
'visible' value into account.
Vladimir Kazanov [Tue, 12 Mar 2024 11:14:54 +0000 (11:14 +0000)]
Improve ert-font-lock assertion parser (Bug#69714)
Fail on files with no assertions, parser now accepts multiple
carets per line and face lists:
* lisp/emacs-lisp/ert-font-lock.el: Assertion parser fix.
* test/lisp/emacs-lisp/ert-font-lock-resources/no-asserts.js:
* test/lisp/emacs-lisp/ert-font-lock-tests.el
(test-parse-comments--no-assertion-error)
(test-syntax-highlight-inline--caret-negated-wrong-face)
(test-macro-test--file-no-asserts): New test cases.
* doc/misc/ert.texi (Syntax Highlighting Tests): More syntax examples.
Eli Zaretskii [Thu, 28 Mar 2024 09:34:25 +0000 (11:34 +0200)]
; * lisp/emacs-lisp/pcase.el (pcase--subtype-bitsets): Doc fix.
Stefan Monnier [Thu, 28 Mar 2024 04:06:00 +0000 (00:06 -0400)]
(pcase-mutually-exclusive): Use auto-generated table
The `pcase-mutually-exclusive-predicates` table was not very
efficient since it grew like O(N²) with the number of
predicates. Replace it with an O(N) table that's auto-generated
from the `built-in-class` objects.
* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Delete variable.
(pcase--subtype-bitsets): New function and constant.
(pcase--mutually-exclusive-p): Use them.
* lisp/emacs-lisp/cl-preloaded.el (built-in-class): Don't inline.
Dmitry Gutov [Thu, 28 Mar 2024 03:41:52 +0000 (05:41 +0200)]
(project-current): Add binding for 'non-essential'
* lisp/progmodes/project.el (project-current):
Add binding for 'non-essential' (bug#69584).
Spencer Baugh [Tue, 26 Mar 2024 12:44:25 +0000 (08:44 -0400)]
Correctly check buffer mtime when displaying xref matches
This was just a typo: we were checking the modification time of
current-buffer instead of checking the modification time of the
passed-in buffer.
This caused matches to not be shown if they weren't present in
the current in-Emacs state of the buffer.
This was easily reproduced by writing a string to a file outside
Emacs, then searching for that string with
e.g. project-find-regexp. The string would seemingly not be
found, although in reality it was found, just not displayed.
* lisp/progmodes/xref.el (xref--find-file-buffer):
Check buf, not current-buffer (bug#70008).
Po Lu [Wed, 27 Mar 2024 02:03:15 +0000 (10:03 +0800)]
Remove IME_FLAG_FORCE_ASCII from password input IME flags
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Passwords might also be non-ASCII, and this flag apparently
requests an IME limited to ASCII characters, rather than just
capable of ASCII input.
Stefan Monnier [Tue, 26 Mar 2024 21:41:42 +0000 (17:41 -0400)]
* lisp/help.el (help-function-arglist): Don't `substitute-command-keys`
Stefan Monnier [Tue, 26 Mar 2024 21:27:29 +0000 (17:27 -0400)]
cl-preloaded.el: Partly revert last change
The change caused type-check errors in auth-source where they use
`:type function` constraints on object slots and expect those to
be able to hold symbols.
* lisp/emacs-lisp/cl-preloaded.el (function): Revert last change.
* test/src/data-tests.el (data-tests--cl-type-of): Use `cl-functionp`
rather than `functionp` to test `function`.
Alan Mackenzie [Tue, 26 Mar 2024 20:59:43 +0000 (20:59 +0000)]
CC Mode: Handle C++20's if consteval
* lisp/progmodes/cc-engine.el (c-after-conditional): Handle the
new keyword in place of a paren sexp after `if'.
* lisp/progmodes/cc-langs.el (c-negation-op-re)
(c-paren-clause-kwds, c-paren-clause-key)
(c-block-stmt-with-kwds, c-block-stmt-with-key): New
lang-consts/vars.
* if-11.cc, if-11.res: New test files.
Stefan Monnier [Tue, 26 Mar 2024 17:14:15 +0000 (13:14 -0400)]
cl-preloaded.el: Fix the type lattice
We generally want types to form not just a DAG but a lattice.
If objects can be both `keyword` and `symbol-with-pos`, this
means there should be a more precise type describing this intersection.
If we ever find the need for such a refinement, we could add
such a `keyword-with-pos` type, but here I took the simpler
route of treating `keyword` not as a proper built-in type but
as a second-class type like `natnum`.
While fixing this problem, also fix the problem we had where
`functionp` was not quite adequate to characterize objects of type
`function`, by introducing a new predicate `cl-functionp` for that.
* lisp/emacs-lisp/cl-preloaded.el (cl-functionp): New function.
(function): Use it.
(keyword): Don't declare it as a built-in type.
(user-ptrp): Remove redundant declaration.
* lisp/emacs-lisp/cl-generic.el (cl--generic--unreachable-types):
Delete constant.
(cl-generic-generalizers): Remove corresponding test.
* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add entry for
`keyword` type.
* lisp/emacs-lisp/comp.el (comp-known-predicates): Fix type for
negative result of `characterp`. Remove duplicate `numberp` entry.
Fix types for `keywordp` now that `keyword` is not a built-in type any more.
* test/src/data-tests.el (data-tests--cl-type-of): Add a few cases.
Remove workaround for `function`.
Eli Zaretskii [Tue, 26 Mar 2024 12:24:16 +0000 (14:24 +0200)]
; Fix recently-changed documentation
* src/buffer.c (syms_of_buffer) <text-conversion-style>:
* doc/lispref/commands.texi (Misc Events): Fix wording and
punctuation of the documentation.
Andrea Corallo [Tue, 26 Mar 2024 10:14:08 +0000 (11:14 +0100)]
Fix native comp prediction on null functionp tested objects
* lisp/emacs-lisp/comp.el (comp-known-predicates)
(comp-known-predicates-h): Update.
(comp--pred-to-pos-cstr, comp--pred-to-neg-cstr): New functions.
(comp--add-cond-cstrs): Make use of them.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
Po Lu [Tue, 26 Mar 2024 02:54:39 +0000 (10:54 +0800)]
Prevent focus "stalemates" on Android
* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus1): New
argument resetWhenChildless.
(invalidateFocus): If a toplevel window has no focus window,
transfer focus to the toplevel itself.
Po Lu [Tue, 26 Mar 2024 02:11:26 +0000 (10:11 +0800)]
Prevent passwords from being recorded during text conversion
* doc/lispref/commands.texi (Misc Events): Document new value of
text-conversion-style.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
<IC_MODE_PASSWORD>: New constant.
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Set TYPE_TEXT_VARIATION_PASSWORD and IME_FLAG_FORCE_ASII if mode
is IC_MODE_PASSWORD.
* lisp/subr.el (read-passwd): Set text-conversion-style to
`password'.
* src/androidgui.h (enum android_ic_mode): New value
ANDROID_IC_MODE_PASSWORD.
* src/androidterm.c (android_reset_conversion): Handle
`password'.
* src/buffer.c (syms_of_buffer)
<&BVAR (current_buffer, text_conversion_style)>: Update doc
string.
* src/textconv.c (syms_of_textconv) <Qpassword>: New DEFSYM.
<Vtext_conversion_edits>: Fix typos in doc string.
Eli Zaretskii [Mon, 25 Mar 2024 13:51:07 +0000 (15:51 +0200)]
Fix removal of bookmark's fringe mark in Info and Dired
* lisp/bookmark.el (bookmark-buffer-file-name): Support Info
buffers.
(bookmark--remove-fringe-mark): Call 'bookmark-buffer-file-name'
instead of using 'buffer-file-name', which could be nil.
(Bug#69974)
Eli Zaretskii [Mon, 25 Mar 2024 12:53:23 +0000 (14:53 +0200)]
Document the 'I' command in buffer-menu
* doc/emacs/buffers.texi (Several Buffers): Document 'I'. Fix
indexing.
(List Buffers): Mention 'I'. (Bug#69987)
* etc/NEWS: Mark 'I' as documented.
Juri Linkov [Mon, 25 Mar 2024 07:45:08 +0000 (09:45 +0200)]
* lisp/vc/diff-mode.el (diff-setup-buffer-type): Remove "\n" from regexp.
Remove extra "\n" from the end of the "diff --git.*" part
of 'diff-outline-regexp' because "\n" is not used in outline-regexp
and causes problems in such cases like when killing hunks
in the diff buffer with outline-minor-mode that loses
the outline icons because outline--fix-buttons-after-change and
outline--fix-up-all-buttons are limited to the single line and
can't match an outline line with a regexp that ends with "\n".
Po Lu [Mon, 25 Mar 2024 07:43:01 +0000 (15:43 +0800)]
Merge remote-tracking branch 'savannah/master' into master-android-1
Po Lu [Mon, 25 Mar 2024 07:42:23 +0000 (15:42 +0800)]
Port restart-emacs to Android 4.3 and earlier
* java/org/gnu/emacs/EmacsService.java (restartEmacs): Run Emacs
from an alarm if required.
Stefan Monnier [Mon, 25 Mar 2024 02:13:44 +0000 (22:13 -0400)]
(byte-optimize-form-code-walker): Simplify a bit
Eliminate a case that matches very rarely and where the default
handling works just as well anyway.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove
redundant case.
Andrea Corallo [Sun, 24 Mar 2024 10:29:37 +0000 (11:29 +0100)]
Fix native compilation for circular immediates (bug#67883)
* test/src/comp-resources/comp-test-funcs.el
(comp-test-67883-1-f): New function.
* lisp/emacs-lisp/comp.el (comp--collect-rhs)
(comp--ssa-rename-insn): Handle setimm aside to avoid unnecessary
immediate manipulation.
(comp--copy-insn-rec): Rename.
(comp--copy-insn): New function.
(comp--dead-assignments-func): Handle setimm aside to avoid
unnecessary.
Po Lu [Sun, 24 Mar 2024 03:05:31 +0000 (11:05 +0800)]
; * lisp/emacs-lisp/cl-preloaded.el (user-ptr): Fix typo.
Author:
Po Lu [Sun, 24 Mar 2024 03:02:34 +0000 (11:02 +0800)]
Don't define user-ptr type when user-ptrp is not present
* lisp/emacs-lisp/cl-preloaded.el (user-ptr): Condition on
presence of predicate function.
Po Lu [Sun, 24 Mar 2024 02:59:54 +0000 (10:59 +0800)]
Improve consistency of content file name handling
* java/org/gnu/emacs/EmacsService.java (getDisplayNameHash):
Always encode file names as modified UTF-8, as insurance against
future changes to undocumented behavior of the JVM.
Stefan Monnier [Sun, 24 Mar 2024 02:48:17 +0000 (22:48 -0400)]
cl-preloaded.el: Improve docstrings of "kinds"
* lisp/emacs-lisp/cl-preloaded.el (cl--class): Improve the docstring.
(built-in-class): Add a docstring.
Stefan Monnier [Sun, 24 Mar 2024 02:27:34 +0000 (22:27 -0400)]
* doc/emacs/help.texi (Name Help): Mention buttons (bug#69935)
Stefan Monnier [Sat, 23 Mar 2024 23:21:26 +0000 (19:21 -0400)]
edebug.el: Better strip instrumentation from backtraces
Rework the code that "cleans" the backtrace for `edebug-pop-to-backtrace`.
The main changes are the following:
- Strip instrumentation from "everywhere" rather than trying to limit the
effect to "code" and leave "data" untouched. This is a worthy
goal, but it is quite difficult to do since code contains data
(so we ended up touching data anyway) and data can also
contain code.
The risk of accidentally removing something because it happens
to look like instrumentation is very low, whereas it was very common
for instrumentation to remain in the backtrace.
- Use a global hash-table to remember the work done, instead of
using separate hash-table for each element. By using a weak
hash-table we avoid the risk of leaks, and save a lot of work
since there's often a lot of subexpressions that appear
several times in the backtrace.
* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Tweak code
layout so the comments are more clear.
(edebug-unwrap): Remove redundant patterns for `closure` and `lambda`.
Add `:closure-dont-trim-context` to the `edebug-enter` pattern,
so it also gets removed (this should have been done in commit
750bc57cbb8d).
(edebug--unwrap-cache): New var.
(edebug-unwrap*): Use it.
(edebug--unwrap1): Delete function. Merged into `edebug-unwrap*`.
Also apply unwrapping to the contents of byte-code functions since they
can refer to lambda expressions captured by the closure.
(edebug--symbol-prefixed-p): Rename from
`edebug--symbol-not-prefixed-p` and adjust meaning accordingly.
(edebug--strip-instrumentation): Adjust accordingly and simplify
a bit by unifying the "lambda" case and the "everything else" case.
(edebug--unwrap-frame): Use `cl-callf` and unwrap arguments even if
they've already been evaluated.
F. Jason Park [Mon, 11 Mar 2024 06:09:59 +0000 (23:09 -0700)]
Reuse command-indicator code for script lines in ERC
* lisp/erc/erc-goodies.el (erc-load-irc-script-lines): Move here from
main file and rework to always use `command-indicator' instead of only
partially, when available. Also use internal "send-action" and
"send-message" interfaces to defer command-handler output until
command lines have been inserted.
* lisp/erc/erc.el (erc-process-input-line): Redo doc string.
(erc-process-script-line): Fold exceptionally overlong line.
(erc-load-irc-script-lines): Move to erc-goodies.el. (Bug#67032)
F. Jason Park [Mon, 11 Mar 2024 06:09:59 +0000 (23:09 -0700)]
Restore leading space to right-margin stamps in ERC
* lisp/erc/erc-stamp.el (erc-insert-timestamp-right): Insert a single
space character immediately before right-side stamps managed by
`erc-stamp--display-margin-mode'. Include it as part of the
`timestamp' field. This behavior was originally present in an earlier
draft of the changes for bug#60936, mainly to favor symmetry between
hard-wrapped fill styles and fill-wrap with regard to stamps. It was
subsequently removed to simplify management, so that the `field' and
`display' intervals aligned.
* test/lisp/erc/erc-stamp-tests.el
(erc-stamp--display-margin-mode--right): Update expected output.
; test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld:
; Add space.
; test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
; Add space.
; test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld: Add space.
; test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Add space.
F. Moukayed [Sun, 17 Mar 2024 16:43:36 +0000 (16:43 +0000)]
Remove mishandled erc-control-default-{fg,bg} faces
Partially revert those portions of
7b4ca9e609e "Leverage inverse-video
for erc-inverse-face" that introduced and managed explicit faces for
the "default" 99 color code.
* lisp/erc/erc-goodies.el (erc-control-default-fg)
(erc-control-default-bg): Remove unused faces originally meant to be
new in ERC 5.6.
(erc-get-fg-color-face, erc-get-bg-color-face): Return nil for n=99.
(erc-controls-interpret, erc-controls-highlight): Preserve an
interval's existing background so "if only the foreground color is
set, the background color stays the same," as explained by
https://modern.ircdocs.horse/formatting#color. (Bug#69860)
Copyright-paperwork-exempt: yes
F. Jason Park [Wed, 20 Mar 2024 06:51:46 +0000 (23:51 -0700)]
Remove unused faces from various erc-goodies tests
; A note to anyone running ERC's test suite while bisecting and
; unlucky enough to land on this commit: apologies for the
; inconvenience. It fails because it includes adjustments for fixes
; only introduced by the subsequent commit. This is obviously
; objectionable but was done knowingly in order to duck the
; copyright-exemption threshold for new contributors.
* test/lisp/erc/erc-goodies-tests.el
(erc-controls-highlight--spoilers)
(erc-controls-highlight--inverse): Remove all mention of stricken
faces `erc-control-default-fg' and `erc-control-default-bg'.
(erc-controls-highlight/default-foreground)
(erc-controls-highlight/default-background): New tests.
(Bug#69860)
Stefan Monnier [Sat, 23 Mar 2024 20:11:07 +0000 (16:11 -0400)]
(describe-package-1): Fix bug#69712
* lisp/emacs-lisp/package.el (describe-package-1): Improve the test to
determine if `maintainers` contains a single cons or a list of conses.
Basil L. Contovounesios [Sat, 23 Mar 2024 19:15:40 +0000 (20:15 +0100)]
; Fix markup in recent change to dired-x.texi.
Joseph Turner [Fri, 8 Mar 2024 05:55:00 +0000 (21:55 -0800)]
Recompute :map when image :scale, :rotation, or :flip changes
Now, when transforming an image, its :map is recomputed to fit.
Image map coordinates are integers, so when computing :map,
coordinates are rounded. To prevent an image from drifting from
its map after repeated transformations, 'create-image' now adds
a new image property :original-map, which is combined with the
image's transformation parameters to recompute :map.
* lisp/image.el (image-recompute-map-p): Add user option to
control whether :map is recomputed when an image is transformed.
(create-image): Create :map from :original-map and vice versa.
(image--delayed-change-size): Fix comment.
(image--change-size, image-rotate, image-flip-horizontally,
image-flip-vertically): Recompute image map after transformation
and mention 'image-recompute-map-p' in docstring.
(image--compute-map): Add function to compute a map from original
map.
(image--compute-original-map): Add function to compute an
original map from map.
(image--scale-map): Add function to scale a map based on :scale.
(image--rotate-map): Add function to rotate a map based on
:rotation.
(image--rotate-coord): Add function to rotate a map coordinate
pair.
(image--flip-map): Add function to flip a map based on :flip.
(image-increase-size, image-decrease-size, image-mouse-increase-size)
(image-mouse-decrease-size): Mention 'image-recompute-map-p' in
docstrings.
* etc/NEWS: Add NEWS entry.
* doc/lispref/display.texi (Image Descriptors): Document :original-map
and new user option 'image-recompute-map-p'.
* test/lisp/image-tests.el (image--compute-map-and-original-map):
Test 'image--compute-map' and 'image--compute-original-map'.
(image-tests--map-equal): Add equality predicate to compare image maps.
(image-create-image-with-map): Test that 'create-image' adds :map
and/or :original-map as appropriate.
(image-transform-map): Test functions related to transforming maps.
(Bug#69602)
Jim Porter [Mon, 18 Mar 2024 23:52:34 +0000 (16:52 -0700)]
Add 'eww-readable-urls'
* lisp/net/eww.el (eww-readable-urls): New option.
(eww-default-readable-p): New function...
(eww-display-html): ... use it.
* test/lisp/net/eww-tests.el (eww-test/readable/default-readable): New
test.
* doc/misc/eww.texi (Basics): Document 'eww-readable-urls'.
* etc/NEWS: Announce this change (bug#68254).
Jim Porter [Sun, 17 Mar 2024 19:01:59 +0000 (12:01 -0700)]
Allow toggling "readable" mode in EWW
Additionally, add an option to prevent adding a new history entry for
each call of 'eww-readable' (bug#68254).
* lisp/net/eww.el (eww-retrieve):
* lisp/net/eww.el (eww-readable-adds-to-history): New option.
(eww-retrieve): Make sure we call CALLBACK in all configurations.
(eww-render): Simplify how to pass encoding.
(eww--parse-html-region, eww-display-document): New functions, extracted
from...
(eww-display-html): ... here.
(eww-document-base): New function.
(eww-readable): Toggle "readable" mode interactively, like with a minor
mode. Consult 'eww-readable-adds-to-history'.
(eww-reload): Use 'eshell-display-document'.
* test/lisp/net/eww-tests.el (eww-test--with-mock-retrieve): Fix indent.
(eww-test/display/html, eww-test/readable/toggle-display): New tests.
* doc/misc/eww.texi (Basics): Describe the new behavior.
* etc/NEWS: Announce this change.
Eli Zaretskii [Sat, 23 Mar 2024 17:10:17 +0000 (19:10 +0200)]
; * doc/misc/dired-x.texi (Omitting Variables): Fix markup.
Spencer Baugh [Sat, 16 Mar 2024 17:11:24 +0000 (17:11 +0000)]
Use 'regexp-opt' in 'dired-omit-regexp'
In my benchmarking, for large dired buffers, using 'regexp-opt'
provides around a 3x speedup in omitting.
'regexp-opt' takes around 5 milliseconds, so to avoid slowing
down omitting in small dired buffers we cache the return value.
Since omitting is now 3x faster, increase 'dired-omit-size-limit'
by 3x. Also, document 'dired-omit-size-limit' better.
* doc/misc/dired-x.texi (Omitting Variables): Document
'dired-omit-size-limit'.
* etc/NEWS: Announce increase of 'dired-omit-size-limit'.
* lisp/dired-x.el (dired-omit--extension-regexp-cache): Add.
(dired-omit-regexp): Use 'regexp-opt'. (Bug#69775)
(dired-omit-size-limit): Increase and improve docs.
Eli Zaretskii [Sat, 23 Mar 2024 16:54:39 +0000 (18:54 +0200)]
* src/coding.c (produce_chars): Fix a thinko (bug#69966).
Eli Zaretskii [Sat, 23 Mar 2024 10:51:40 +0000 (06:51 -0400)]
Merge from origin/emacs-29
e95a8622263 ; * lisp/keymap.el (key-parse): Fix processing of "[TAB]"...
afb7a23e7b9 ; Improve documentation of 'backup-by-copying'
Eli Zaretskii [Sat, 23 Mar 2024 10:51:40 +0000 (06:51 -0400)]
; Merge from origin/emacs-29
The following commit was skipped:
51848e4731f * Fix missing `comp-files-queue' update (bug#63415).
Eli Zaretskii [Sat, 23 Mar 2024 10:51:39 +0000 (06:51 -0400)]
Merge from origin/emacs-29
689f04a2ddf Clarify description of format-spec truncation
759dedfab07 More accurate documentation of 'rmail-mail-new-frame'
fa79de7c6b8 ; * lisp/calendar/calendar.el: Remove extra space.
7f6e335f4b4 Fix documentation of M-SPC in user manual
5bdc2436c64 ; * lisp/emacs-lisp/cl-macs.el (cl-labels): Fix stray dif...
8014dbb2ad8 * admin/notes/bugtracker: Minor copyedit.
06a991e7e87 ; * admin/notes/bugtracker: Minor copyedit.
c890622e1a9 Tweak regexp for object initializers in csharp-mode (bug#...
f48babb1120 `term-mode': mention the keymap to add keybindings to
8cf05d9be12 Fix 'shortdoc-copy-function-as-kill'
d5901f3f05e Improve documentation of 'edebug-print-*' variables
Po Lu [Sat, 23 Mar 2024 10:15:28 +0000 (18:15 +0800)]
Merge remote-tracking branch 'savannah/master' into master-android-1
Po Lu [Sat, 23 Mar 2024 10:14:12 +0000 (18:14 +0800)]
Enable calling decode_coding_object with both SRC and DST_OBJECT Qnil
* src/coding.c (growable_destination): A C destination is also
reallocable.
(produce_chars): Don't consider source and destination identical
if they are EQ but Qnil.
Po Lu [Sat, 23 Mar 2024 10:12:56 +0000 (18:12 +0800)]
Minor adjustments to last change
* src/androidvfs.c (android_vfs_convert_name): Simplify.
(android_saf_tree_readdir, android_root_name): Remove redundant
statements.
Eli Zaretskii [Sat, 23 Mar 2024 09:50:55 +0000 (11:50 +0200)]
; Fix doc strings of some treesit-related functions
* lisp/treesit.el (treesit-defun-tactic)
(treesit-defun-name-function, treesit-thing-at-point)
(treesit-defun-at-point):
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset):
* lisp/progmodes/c-ts-mode.el (c-ts-mode-toggle-comment-style)
(c-ts-mode-indent-style, c-ts-mode-emacs-sources-support)
(c-ts-mode--syntax-propertize, c-ts-mode--anchor-prev-sibling)
(c-ts-mode--standalone-parent-skip-preproc)
(c-ts-mode--standalone-grandparent, c-ts-mode--else-heuristic)
(c-ts-mode--declarator-identifier)
(c-ts-mode--fontify-declarator, c-ts-mode--fontify-variable)
(c-ts-mode--defun-valid-p)
(c-ts-mode--defun-for-class-in-imenu-p)
(c-ts-mode--defun-skipper, c-ts-mode--emacs-defun-p)
(c-ts-mode--emacs-defun-at-point)
(c-ts-mode--emacs-current-defun-name, c-ts-mode--reverse-ranges)
(c-ts-mode, c++-ts-mode, c-or-c++-ts-mode): Doc fixes.
Eli Zaretskii [Sat, 23 Mar 2024 09:09:57 +0000 (11:09 +0200)]
Improve support for preprocessor macros in 'c/c++-ts-mode'
* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-name)
(c-ts-base-mode): Support preprocessor macros as defuns. This
fixes both navigation by defuns and add-log when cpp macros are at
point.
Eli Zaretskii [Sat, 23 Mar 2024 07:51:47 +0000 (09:51 +0200)]
Avoid infinite recursion in 'image-mode--display'
* lisp/image-mode.el (image-mode): Suspend major mode only if it
is not already 'image-mode'. (Bug#69785)
Dionisio E Alonso [Wed, 20 Mar 2024 15:06:30 +0000 (17:06 +0200)]
Add BasedPyright LSP server alternative for Eglot's 'python-mode'
* lisp/progmodes/eglot.el (eglot-server-programs): Add
BasedPyright, a new server for python, forked from the
unmaintained 'pyright' LSP server. (Bug#69925)
Copyright-paperwork-exempt: yes
Po Lu [Sat, 23 Mar 2024 07:37:43 +0000 (15:37 +0800)]
Correctly handle non-BMP characters in Android content file names
* lisp/term/android-win.el (android-encode-jni)
(android-decode-jni, android-jni): New coding system, for
Android file names and runtime data.
* src/androidterm.h (syms_of_androidvfs): New function.
* src/androidvfs.c (struct android_special_vnode): New field
special_coding_system.
(android_saf_tree_readdir): Decode the file name using the
android-jni coding system.
(special_vnodes): <contents>: Specify a file name coding system.
(android_vfs_convert_name): New function.
(android_root_name): If a special coding system be specified for
a special vnode, convert components to it before invoking its
name function.
(syms_of_androidvfs): New symbol Qandroid_jni.
* src/emacs.c (android_emacs_init): Call syms_of_androidvfs.
john muhl [Tue, 12 Mar 2024 16:17:15 +0000 (11:17 -0500)]
; Remove unneeded group in lua-ts-mode defcustoms
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode-hook):
(lua-ts-indent-offset):
(lua-ts-luacheck-program):
(lua-ts-inferior-buffer):
(lua-ts-inferior-program):
(lua-ts-inferior-options):
(lua-ts-inferior-startfile):
(lua-ts-inferior-prompt):
(lua-ts-inferior-prompt-continue):
(lua-ts-inferior-history):
(lua-ts-indent-continuation-lines): Remove :group. (bug#69910)
john muhl [Wed, 20 Mar 2024 00:46:12 +0000 (19:46 -0500)]
; Open inferior Lua buffer in a window, not a frame
* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Replace
'display-buffer-pop-up-window' with
'display-buffer-pop-up-frame'. (bug#69909)
Stefan Monnier [Fri, 22 Mar 2024 22:44:54 +0000 (18:44 -0400)]
Fix recent test regressions
* lisp/emacs-lisp/pp.el (pp-fill): Don't cut between `#` and `(`.
* test/lisp/help-fns-tests.el (help-fns-test-built-in)
(help-fns-test-interactive-built-in, help-fns-test-lisp-defun)
(help-fns-test-lisp-defsubst):
* test/src/emacs-module-tests.el (module/describe-function-1):
Adjust tests to new wording in `describe-function`.
Stefan Monnier [Fri, 22 Mar 2024 21:03:15 +0000 (17:03 -0400)]
etc/NEWS: Document the new behavior of `describe-function`
I pushed commit
accd79c93935 by accident.
Related to bug#69935
Stefan Monnier [Fri, 22 Mar 2024 20:46:28 +0000 (16:46 -0400)]
(pp-fill): Cut before parens and dots
The `pp-fill` code sometimes end up generating things like:
(foo .
bar)
instead of
(foo
. bar)
so make sure we cut before rather than after the dot (and open
parens while we're at it).
* lisp/emacs-lisp/pp.el (pp-fill): Cut before parens and dots.
* test/lisp/emacs-lisp/pp-tests.el (pp-tests--dimensions): New function.
(pp-tests--cut-before): New test.
Stefan Monnier [Fri, 22 Mar 2024 01:08:58 +0000 (21:08 -0400)]
(help-fns-function-description-header): Print functions' type
Instead of choosing English words to describe the kind of function,
use the actual type of the function object (from `cl-type-of`)
directly, and make it a button to display info about that type.
* lisp/help-fns.el (help-fns-function-description-header): Use the
function's type name in the description instead of "prose".
Use `insert` instead of `princ`, so as to preserve the text-properties
of the button.
* lisp/emacs-lisp/cl-extra.el (cl-help-type): Move to `help-mode.el`
and rename to `help-type`.
(cl--describe-class): Adjust accordingly.
* lisp/help-mode.el (help-type): New type, moved and renamed from
`cl-extra.el`.
Eli Zaretskii [Fri, 22 Mar 2024 07:54:37 +0000 (09:54 +0200)]
; * lisp/help-fns.el (help-fns-function-name): Doc fix.
Po Lu [Fri, 22 Mar 2024 07:24:28 +0000 (15:24 +0800)]
Fix display of custom menus after putative cosmetic change
* lisp/wid-edit.el (widget-setup): Restore version from before
the previous commit.
Stefan Monnier [Fri, 22 Mar 2024 01:43:38 +0000 (21:43 -0400)]
* lisp/help.el (help--analyze-key): Use `help-fns-function-name`
Stefan Monnier [Thu, 21 Mar 2024 23:40:20 +0000 (19:40 -0400)]
(help-fns-function-name): New function
Consolidate code used in profiler and help--describe-command,
and improve it while we're at it.
Also use #' to quote a few function names along the way.
* lisp/help-fns.el (help-fns--function-numbers, help-fns--function-names):
New vars.
(help-fns--display-function): New aux function.
(help-fns-function-name): New function, inspired from
`help--describe-command`.
* lisp/help.el (help--describe-command): Use `help-fns-function-name`.
(help--for-help-make-sections): Remove redundant "" arg to `mapconcat`.
* lisp/profiler.el (profiler-format-entry, profiler-fixup-entry):
Delete functions.
(profiler-report-make-entry-part): Use `help-fns-function-name` instead.
(profiler-report-find-entry): Use `push-button`.
* lisp/transient.el (transient--debug): Use `help-fns-function-name`
when available.
Stefan Monnier [Thu, 21 Mar 2024 23:26:33 +0000 (19:26 -0400)]
(make-help-screen): Move most of the code out to a function
This avoids problems like variable-name capture and lets compiler messages
point to the actual source code.
* lisp/help-macro.el (help--help-screen): New function, extracted from
`make-help-screen`.
(make-help-screen): Use it.
Jonas Bernoulli [Thu, 21 Mar 2024 22:55:38 +0000 (23:55 +0100)]
Update to Transient
v0.6.0-1-gcaef3347
Stefan Monnier [Thu, 21 Mar 2024 22:27:03 +0000 (18:27 -0400)]
(describe-symbol-backends): Fix addition of the "type" backend
That backend was added from `cl-extra.el` with no autoload, so
(describe-symbol `advice) failed to show the info about
the `advice` type unless `cl-extra.el` had been loaded beforehand.
`C-h o RET advice RET` worked by accident because the completion
table uses `cl-some` which is autoloaded from `cl-extra.el`.
* lisp/help-mode.el (describe-symbol-backends): Add the "type" backend.
* lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Don't add the
"type" backend here.
Stefan Monnier [Thu, 21 Mar 2024 22:16:41 +0000 (18:16 -0400)]
byte-opt.el: Remove test that's not applicable any more
* lisp/emacs-lisp/byte-opt.el: Remove left-over test for ancient
byte-compiled representation.
Eli Zaretskii [Thu, 21 Mar 2024 20:12:40 +0000 (22:12 +0200)]
; * lisp/keymap.el (key-parse): Fix processing of "[TAB]". (Bug#69893)
Eli Zaretskii [Thu, 21 Mar 2024 19:35:24 +0000 (21:35 +0200)]
; Improve documentation of 'backup-by-copying'
* doc/emacs/files.texi (Backup Copying): Recommend
'backup-by-copying' for files on file-hosting services. (Bug#69930)
Stefan Monnier [Thu, 21 Mar 2024 16:28:54 +0000 (12:28 -0400)]
Speed up `describe-char` when a property has a large value
Doing `C-u C-x =` on a buffer position where the overlay/text
properties hold large values (e.g. inside the profiler report)
can be surprisingly slow because it pretty prints all those properties.
Change the code to do the pretty printing more lazily.
While at it, share that duplicated code between `descr-text.el` and
`wid-browse.el`.
* lisp/emacs-lisp/pp.el (pp-insert-short-sexp): New function.
* lisp/descr-text.el (describe-text-sexp): Delete function.
(describe-property-list): Use `pp-insert-short-sexp` instead.
* lisp/wid-browse.el (widget-browse-sexp): Use `pp-insert-short-sexp`
and `widget--allow-insertion`.
Stefan Monnier [Thu, 21 Mar 2024 16:08:02 +0000 (12:08 -0400)]
wid-edit.el: Cosmetic changes
* lisp/wid-edit.el: Use #' to quote function names.
(widget--simplify-menu, widget-echo-help): Explicitly specify the
lexenv to `eval`.
(widget-choose, widget-get-sibling, widget-setup, widget-field-find)
(widget-choice-action, widget-checklist-value-get)
(widget-radio-value-create, widget-radio-value-set)
(widget-radio-action, widget-editable-list-delete-at)
(widget-group-value-create, widget-choice-prompt-value): Use `dolist`.
(widget-convert): Hoist `(setq current` out of the ifs.
(widget-convert): Hoist `(setq keys` out of the if.
(widget-after-change): Hoist `(setq begin` out of the if.
(widget-default-completions): Use `cond`.
(widget-default-value-set): Hoist `goto-char` out of the if.
(widget-choice-action): Hoist `nth` out of the if.
(widget-checkbox-action): Hoist `widget-apply` out of the if.
(widget-editable-list-value-create): Hoist `car` out of the if.
(widget-editable-list-entry-create): Hoist `(setq child ...` out of the if.
(widget-documentation-link-action): Fold `if` into `cond`.
(widget-key-sequence-value-to-external): Use `key-parse`.
(widget-plist-convert-option, widget-alist-convert-option):
Hoist `(setq key-type` out of the if.
Stefan Monnier [Thu, 21 Mar 2024 15:38:12 +0000 (11:38 -0400)]
(widget--allow-insertion): New macro
* lisp/wid-edit.el (widget--allow-insertion): New macro.
(widget-specify-insert, widget-insert, widget-setup)
(widget-default-delete, widget-editable-list-insert-before)
(widget-editable-list-delete-at): Use it.
Po Lu [Thu, 21 Mar 2024 12:45:25 +0000 (20:45 +0800)]
; * src/xterm.c (syms_of_xterm): Document x-*-keysym's default values.
Andrea Corallo [Wed, 17 May 2023 13:28:46 +0000 (15:28 +0200)]
* Fix missing `comp-files-queue' update (bug#63415).
* lisp/emacs-lisp/comp.el (native--compile-async): Update
`comp-files-queue' for real.
Adam Porter [Sat, 9 Mar 2024 05:43:14 +0000 (23:43 -0600)]
'vtable-update-object' can now be called with one argument
It's often necessary to update the representation of a single
object in a table (e.g a struct, whose identity does not change
when its slots'
values are changed). To do so, now the function may be called
like this:
(vtable-update-object table object)
Instead of like this:
(vtable-update-object table object object)
This also documents the behavior of the just-discovered limitation filed
as bug#69837.
* lisp/emacs-lisp/vtable.el (vtable-update-object): Make 'old-object'
argument optional. (Bug#69666)
* doc/misc/vtable.texi (Interface Functions): Update documentation.
* etc/NEWS: Add news entry.
Basil L. Contovounesios [Sun, 17 Mar 2024 12:04:32 +0000 (13:04 +0100)]
Clarify description of format-spec truncation
* doc/lispref/strings.texi (Custom Format Strings): Mention that
precision specifier affects both '<' and '>' truncation (bug#69822).
* lisp/format-spec.el (format-spec, format-spec--do-flags): Use same
terminology as 'format', especially when referring to its behavior.
Eli Zaretskii [Thu, 21 Mar 2024 08:55:59 +0000 (10:55 +0200)]
More accurate documentation of 'rmail-mail-new-frame'
* doc/emacs/rmail.texi (Rmail Reply): More accurate documentation
of the effects of 'rmail-mail-new-frame'. (Bug#69738)
Eli Zaretskii [Thu, 21 Mar 2024 08:25:56 +0000 (10:25 +0200)]
Speed up display of RTL text with many character compositions
* src/bidi.c (bidi_level_start): New function.
* src/dispextern.h (bidi_level_start): Add prototype.
* src/xdisp.c (compute_stop_pos, set_iterator_to_next)
(get_visually_first_element, next_element_from_buffer): Call
'bidi_level_start' when looking for composed characters backwards,
to set limit of searching back, instead of looking all the way to
BOB. (Bug#69385)
Juri Linkov [Thu, 21 Mar 2024 07:49:34 +0000 (09:49 +0200)]
; * lisp/calendar/calendar.el: Remove extra space.
Adam Porter [Thu, 21 Mar 2024 07:13:28 +0000 (02:13 -0500)]
Avoid recomputing the whole table in 'vtable--recompute-numerical'
Each element of LINE being tested is a list, the first element of
which is the value actually being represented in the table.
Previously, the 'numberp' test would always fail, because it was
being compared with the list rather than the intended value in it;
that could cause the whole table to be recomputed, sometimes
unnecessarily.
* lisp/emacs-lisp/vtable.el (vtable--recompute-numerical): Test the
car of ELEM, not ELEM itself, which is a list. (Bug#69927)
Po Lu [Thu, 21 Mar 2024 06:23:40 +0000 (14:23 +0800)]
Android compatibility fixes
* doc/emacs/android.texi (Android Windowing): Document
restrictions on number of windows under Android 4.4 and earlier.
* java/AndroidManifest.xml.in <EmacsActivity>
<EmacsOpenActivity, EmacsMultitaskActivity>: Assign each class
of activity a unique task affinity.
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Remove redundant priority assignment.
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Handle
file URIs when processing attachments from a mailto URI, and
check for KitKat before opening content ones.
* java/org/gnu/emacs/EmacsWindow.java <pointerMap>
(figureChange): Replace coordinate HashMap with a SparseArray.
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow): Don't specify FLAG_ACTIVITY_NEW_DOCUMENT on
systems where it is absent.
Andrea Corallo [Wed, 20 Mar 2024 15:59:33 +0000 (16:59 +0100)]
; * lisp/emacs-lisp/comp-run.el (comp-run-async-workers): Fix indentation.
Eli Zaretskii [Wed, 20 Mar 2024 14:08:15 +0000 (16:08 +0200)]
; Minor copyedits of last change.
Andrea Corallo [Wed, 20 Mar 2024 13:49:28 +0000 (14:49 +0100)]
; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example.
Eli Zaretskii [Wed, 20 Mar 2024 12:45:24 +0000 (14:45 +0200)]
Fix documentation of M-SPC in user manual
* doc/emacs/killing.texi (Deletion): Fix documentation of
'cycle-spacing'. (Bug#69905)
Eli Zaretskii [Wed, 20 Mar 2024 12:27:25 +0000 (14:27 +0200)]
; Fix doc strings of recent changes
* src/comp.c (syms_of_comp) <comp-sanitizer-active>:
* lisp/emacs-lisp/comp.el (comp-sanitizer-emit): Doc fixes.
Andrea Corallo [Wed, 20 Mar 2024 10:49:32 +0000 (11:49 +0100)]
; * lisp/emacs-lisp/comp-cstr.el (comp--normalize-typeset0): Fix comment.
Andrea Corallo [Wed, 21 Feb 2024 21:31:45 +0000 (22:31 +0100)]
Add native compiler sanitizer
* src/comp.c (ABI_VERSION): Bump new version.
(CALL0I): Uncomment.
(helper_link_table, declare_runtime_imported_funcs): Add
'helper_sanitizer_assert'.
(Fcomp__init_ctxt): Register emitter for
'helper_sanitizer_assert'.
(helper_sanitizer_assert): New function.
(syms_of_comp): 'helper_sanitizer_assert' defsym.
(syms_of_comp): 'comp-sanitizer-error' define error.
(syms_of_comp): 'comp-sanitizer-active' defvar.
* lisp/emacs-lisp/comp.el (comp-passes): Add 'comp--sanitizer'.
(comp-sanitizer-emit): Define var.
(comp--sanitizer): Define function.
* lisp/emacs-lisp/comp-run.el (comp-run-async-workers): Forward
'comp-sanitizer-emit'.
Robert Pluim [Wed, 20 Mar 2024 08:33:37 +0000 (09:33 +0100)]
; * lisp/emacs-lisp/cl-macs.el (cl-labels): Fix stray diff marker.
Po Lu [Wed, 20 Mar 2024 02:23:42 +0000 (10:23 +0800)]
Respect file display names during Android drag-and-drop
* java/org/gnu/emacs/EmacsService.java (buildContentName):
Remove redundant projection argument to resolver.query.
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): If a
content resolver is available, attempt to convert content URIs
into file names in advance.
* lisp/term/android-win.el (android-handle-dnd-event): Adjust
correspondingly.
Kévin Le Gouguec [Mon, 18 Mar 2024 18:47:59 +0000 (19:47 +0100)]
Fix vc-git test when no identities are configured
Reported by john muhl <jm@pub.pink>.
* test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo): Set
some environment variables (lifted from vc-tests.el) to let
'git commit' compute dummy author and committer identities.
Eli Zaretskii [Tue, 19 Mar 2024 12:45:45 +0000 (14:45 +0200)]
Unbreak the Cygw32 build broken by resent WTS_SESSION changes
* src/w32xfns.c (WTS_VIRTUAL_CLASS):
* src/w32fns.c (WTS_VIRTUAL_CLASS, WM_WTSSESSION_CHANGE)
(WTS_SESSION_LOCK): Define only for WINDOWSNT.
* src/w32xfns.c (drain_message_queue): Call
'reset_w32_kbdhook_state' only for WINDOWSNT. (Bug#69888)
Andrea Corallo [Tue, 19 Mar 2024 09:48:18 +0000 (10:48 +0100)]
* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-93): Add test.
Andrea Corallo [Tue, 19 Mar 2024 09:41:52 +0000 (10:41 +0100)]
* Use 'cl-type-of' in comp-cstr.el
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-homogeneous-no-range)
(comp-cstr-union-1-no-mem, comp-cstr-intersection-no-hashcons):
Make use of 'cl-type-of' in place of 'type-of'.
Po Lu [Tue, 19 Mar 2024 04:17:43 +0000 (12:17 +0800)]
Update android.texi
* doc/emacs/android.texi (Android Startup): Describe
/content/by-authority-named.
Po Lu [Tue, 19 Mar 2024 04:08:17 +0000 (12:08 +0800)]
Respect display names of Android content URIs
* java/org/gnu/emacs/EmacsNative.java (displayNameHash): New
function.
* java/org/gnu/emacs/EmacsService.java (buildContentName): New
argument RESOLVER. Generate names holding URI's display name if
available. All callers changed.
* lisp/international/mule-cmds.el (set-default-coding-systems):
Fix file name coding system as utf-8-unix on Android as on Mac
OS.
* src/androidvfs.c (enum android_vnode_type): New enum
ANDROID_VNODE_CONTENT_AUTHORITY_NAMED.
(android_content_name): Register root directories for this new
type.
(displayNameHash): New function.
(android_get_content_name): New argument WITH_CHECKSUM. If
present, treat the final two components as a pair of checksum
and display name, and verify and exclude the two.
(android_authority_name): Provide new argument as appropriate.
(android_authority_initial_name): New function.
Eli Zaretskii [Mon, 18 Mar 2024 13:59:54 +0000 (15:59 +0200)]
; * lisp/vc/vc-git.el (vc-git--out-str): Doc fix.